package com.coding.controller;

import com.coding.base.pojo.BaseModel;
import com.coding.service.PoemwayService;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @auther wangchenghao
 * @date 2020/7/30
 **/
@Controller
@ResponseBody
@RequestMapping("poemway")
public class PoemwayController {
    @Autowired
    PoemwayService poemwayService;

    @ApiOperation("获得四条诗路信息")
    @RequestMapping(value = "/getInfo", method = {RequestMethod.GET})
    public BaseModel getInfo() throws Exception {
        BaseModel model = new BaseModel();
        poemwayService.getallways(model);
        return model;
    }

    @ApiOperation("查询诗路主要景点信息(浙东-1，大运河-2，钱塘-3，瓯江-4）")
    @RequestMapping(value = "/getMainPlace", method = {RequestMethod.GET})
    public BaseModel getMainPlace(@ApiParam("poemway_id") @RequestParam(value = "poemway_id", required = true) Integer poemway_id) throws Exception {
        BaseModel model = new BaseModel();
        poemwayService.getwaywithmain(poemway_id,model);
        return model;
    }
}
